/*************************
* FIGURE 1
*************************/

* (a) Voting time
clear
use votetime.dta
twoway (hist votetime, frac discrete width(1) lcolor(gs5) color(gs12) ///
       graphregion(color(white)) xlabel(6 12 18 24) ///
	   xtitle("Voting Time (hr)") ytitle("Fraction of Votes"))
	   
	   
* (b) Congressional events 
clear
use partytime.dta
sort entertainment
by event_id, sort: gen tt = 1 if _n == 1
sum start if tt ==1
replace entertainment = upper(entertainment)
gen afterhr = .
replace afterhr = 1 if start >= 18 & start !=.
replace afterhr = 0 if start < 18 & start !=.
tab afterhr if tt ==1
tab afterhr if tt == 1 & strpos(entertainment, "FUNDR") > 0

twoway (hist start if tt ==1, discrete width(1) frac ///
        lcolor(gs5) fcolor(gs12) graphregion(color(white)) ///
		xtitle("Event Starting Time (hr)") ytitle("Fraction of Events") ///
		xlabel(6 12 18 24)) 

